<template>
	<view class="content">
		<view class="btn-row">
			<button v-if="!this.hasLogin" type="primary" class="primary" @tap="bindLogin">登录</button>
			<button else="this.hasLogin" type="default" @tap="bindLogout">退出登录</button>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			hasLogin: false
		};
	},
	methods: {
		bindLogin() {
			uni.redirectTo({
				url: '../login/login'
			});
		},
		bindLogout() {
			this.removeChangeData();
			this.bindLogin();
		}
	},
	onLoad() {
		if (this.changeData()) this.hasLogin = true;
	}
};
</script>

<style></style>
